/**
 * 公共方法
 */
import Vue from 'vue';

const myObject = {};
myObject.isWeixin = () => {
	const u = navigator.userAgent.toLowerCase();
	const isAndroid = u.indexOf('android') > -1 || u.indexOf('adr') > -1;
	const isiOS = !!u.match(/\(i[^;]+;( u;)? cpu.+mac os x/);
	const isPhone = isAndroid || isiOS;
	const isWeixin = u.indexOf('micromessenger') !== -1;
	const isPc = !u.match(
		/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
	);
	// if(isWeixin == true){
	//   alert('weixin');
	// } else if(isAndroid == true || isiOS == true){
	//   alert('isAndroid');
	// } else {
	//   alert('isPc');
	// }
	return {
		isWeixin,
		isPhone,
		isPc,
	};
};
//是否为数组

//封装uni.request方法  
//获取json数据ajax请求 methodName:方法名,
//methodName可为null, 为null时默认请求地址方法，如 handler的 ProcessRequest
//async是否异步：默认true,异步请求需要传入回调函数
//data Json参数如{a:"aValue",b:"bValue"}
//data 数组参数形式[{name:"a",value"aValue"},{name:"b",value"bValue"}]
//type:请求类别默认post
//dataType:预期服务器返回的数据类型[string,xml,html,script,json(默认),text]
//isloading:是否加载遮罩层，默认为true
function _ajaxJson(url, method, data, callback, async, type, dataType, isloading) {
	//这里的that是myObject本身
	var that = this;
	var __serverpath = that.serverUrl;
	dataType = dataType || "json";
	if (url == undefined) {
		alert('ajaxjson url is not empty');
		return false;
	}
	url = "/bpmway"+ url;
	uni.showLoading({
		mask: true,
		title: "处理中...",
	});
	if (async ==undefined || async ==null) {
		async = true;
	}
	if (async &&(isloading == undefined || isloading == null)) {
		isloading = true;
	} else if (isloading == undefined || isloading == null || async ==undefined || async ==null) {
		isloading = false;
	}
	method = method || '';
	var index = url.indexOf('?');
	if (index > -1 && method) {
		var controller = url.substr(0, index);
		var parmStr = url.substring(index);
		url = controller + method + '/' + parmStr;
	} else if (method) {
		url = url + method;
	}
	if (__serverpath != '' && !that.toStartWith(url, __serverpath) && !that.toStartWith(url, 'http')) {
		url = __serverpath + url;
	}

	var json = {};
	var isAsync = async;
	//只能是一个Object的Json方式
	var theData = {};
	if (myObject.toIsArray(data)) {
		//将name value对象的数组转Json
		theData = myObject.toArrToJson(data);
	} else {
		//Json形式
		theData = data;
	}
	var isCorsRequest = false;
	var isWithCredentials = false;
	if (that.toStartWith(url, 'http')) {
		isCorsRequest = true;
		isWithCredentials = true;
	}
	if (isloading) {
		// uni.showLoading({
		// 	mask: true,
		// 	title: "加载中..."
		// });
	}
	var author= sessionStorage.getItem("f2bpmAuthor");
	if(!author){
		uni.showToast({
			title: "用户过期，请重新登录",
			duration: 3000,
			mask: false,
			icon:'none'
		});
		setTimeout(()=>{
			uni.reLaunch({
				url: '/workspaces/views/login/login'
			});
		},2000)
		return;
	}
    author=eval("("+author+")");
	var f2bpmToken=author.token;
	uni.request({
		url: url,
		data: theData,
		header: {
			'Content-type': 'application/x-www-form-urlencoded',
			f2bpmToken: f2bpmToken
		},
		method: type || 'POST',
		dataType: dataType,
		success: (res) => {
			var loginStatus = res.statusCode;
			var d = res.data;
			//登录状态:登录异常  
			if (loginStatus == 0 || loginStatus == "" || loginStatus == undefined) {
				uni.showModal({
					title: data,
					content: '',
					success: function() {
						uni.navigateTo({
							url: "/workspaces/views/login/login"
						});
					}
				});
				return;
			}
			//"token过期", 111 "无效的token", 110 "无效签名", 104 "api key无效", 101
			if (d && typeof(d) == 'object' && d.success != undefined && d.success == false && d.code != undefined && d.code !=
				null && (d.code == 110 || d.code == 111 || d.code == 101 || d.code == 104)) {
				uni.navigateTo({
					url: "/workspaces/views/login/login"
				});
				return false;
			}
			if (callback && typeof(callback) != 'function') {
				throw TypeError('the callback parameter not is a function');
			} else if (callback) {
				callback(d);
			}
			json = d;
		},
		complete: () => {
			if (isloading) {
				uni.hideLoading();
			}
		},
		fail() {
			if (res.errMsg.indexOf("ERR_CONNECTION_REFUSED")) {
				uni.showModal({
					showCancel:false,
					content:'网络错误，请求失败'
				});
			}
			throw new Error('请求失败:' + url);
		}
	});
}

/*********************最小单元通用独立方法开始 也可被页面直接使用，供prototype或类使用*********************************/

/*********************共用的对象最小单元通用独立方法开始*********************/

//克隆数组
//hasObjcet,数组是否存在对象
function cloneArray(array, hasObjcet) {
	var newArray = [];
	if (array) {
		if (hasObjcet == true) {
			for (var i = 0, len = array.length; i < len; i++) {
				if (typeof(array[i]) == 'object') {
					newArray.push(Object.toClone(array[i]));
				} else {
					newArray.push(array[i]);
				}
			}
		} else {
			newArray = null;
		}
	}
	return newArray;
}

//深度克隆
function deepClone(obj) {
	var result, oClass = isClass(obj);
	//确定result的类型
	if (oClass === 'Object') {
		result = {};
	} else if (oClass === 'Array') {
		result = [];
	} else {
		return obj;
	}
	for (key in obj) {
		var copy = obj[key];
		if (isClass(copy) == 'Object') {
			result[key] = arguments.callee(copy); //递归调用
		} else if (isClass(copy) == 'Array') {
			result[key] = arguments.callee(copy);
		} else {
			result[key] = obj[key];
		}
	}
	return result;
}

//返回传递给他的任意对象的类
function isClass(o) {
	if (o === null) return 'Null';
	if (o === undefined) return 'Undefined';
	return Object.prototype.toString.call(o).slice(8, -1);
}

function isDate(object) {
	return typeof object == "date";
}

function isArray(object) {
	return Array.isArray(object)
}

function isJavaDateObject(dateObject) {
	if (dateObject.time) {
		return true;
	}
	return false;
}

//首字母大写
function _StringCapitalize() {
	return this.charAt(0).toUpperCase();
}

//判断字符串是否以指定字符开头
function _StringStartWith(str, startStr, ignorecase) {
	if (ignorecase == undefined || ignorecase == null) {
		ignorecase = true;
	}
	var startString = str.substr(0, startStr.length);
	return ignorecase ? startString.toLocaleLowerCase() == startStr.toLocaleLowerCase() : startString == startStr;
}

//判断字符串是否以指定字符结尾
function _StringEndWith(str, endStr, ignorecase) {
	ignorecase = ignorecase || true;
	var endString = str.substring(str.length - endStr.length);
	return ignorecase ? endString.toLocaleLowerCase() == endStr.toLocaleLowerCase() : endString == endStr;

}

//去除字符两边的标签
function _StringtrimTags(str) {
	return str.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi, '');
}

//去除字符两边的空隔
function _Stringtrim(str) {
	if (str == undefined || str.length == 0) return '';
	return str.replace(/^\s+|\s+$/g, '');
}

//是否包含了指定字符串
function _IncludeString(str, pattern) {
	return str.indexOf(pattern) > -1;
}

//格式化日期时间：format：yyyy-MM-dd,yyyy-MM-dd hhmmss
function _DateFormat(format) {

	var o = {
		'M+': this.getMonth() + 1, //month
		'd+': this.getDate(), //day
		'h+': this.getHours(), //hour
		'H+': this.getHours(), //hour
		'm+': this.getMinutes(), //minute
		's+': this.getSeconds(), //second
		'q+': Math.floor((this.getMonth() + 3) / 3), //quarter
		'S': this.getMilliseconds() //millisecond
	};
	if (/(y+)/.test(format)) {
		format = format.replace(RegExp.$1,
			(this.getFullYear() + '').substr(4 - RegExp.$1.length));
	}
	for (var k in o) {
		if (new RegExp('(' + k + ')').test(format)) {
			format = format.replace(RegExp.$1,
				RegExp.$1.length == 1 ? o[k] :
				('00' + o[k]).substr(('' + o[k]).length));
		}
	}
	return format;
}

//保留指定中文长度，默认25中文字符长度，truncation：默认为...
function _Truncate2(str, length, truncation) {
	if (str.length == 0) return '';
	length = length || 25;
	truncation = Object.toIsUndefined(truncation) ? '...' : truncation;
	return str.length > length ? str.slice(0, length) + truncation : str;
}

//保留指定中文长度，默认25中文字符长度，truncation：默认为...
function _Truncate(length, truncation) {
	if (this.length == 0) return '';
	length = length || 25;
	truncation = Object.toIsUndefined(truncation) ? '...' : truncation;
	return this.length > length ?
		this.slice(0, length) + truncation : String(this);
}

//加1操作，对数字类型的字符串
function _Succ(str) {
	return str.slice(0, str.length - 1) +
		String.fromCharCode(str.charCodeAt(str.length - 1) + 1);
}

//复制N次字符串
function _CopyTimes(str, count) {
	return count < 1 ? '' : new Array(count + 1).join(str);
}

/*********************this 对象最小单元通用独立方法结束*********************/

/*********************最小单元通用独立方法开始 也可被页面直接使用，供prototype或类使用*********************************/

//类似C#StringFormat的格式化，这里更强大，支持JSON键值方式
//例子 var a=StringFormat("Result is {0},{1}",22,33);
//var b=StringFormat("Result is {Name},{Age}",{Name:"Jhon",Age:14});
function _StringFormat(str, object) {
	var array = Array.prototype.slice.call(arguments, 1);
	return str.replace(/\\?\{([^{}]+)\}/gm, function(match, name) {
		if (match.charAt(0) == '\\') {
			return match.slice(1);
		}
		var index = Number(name);
		if (index >= 0) {
			return array[index];
		}
		if (object && object[name] != void 0) {
			return object[name];
		}
		return '';

	});
}

//获取Url传递的参数值
function _QueryString(Parametername) {
	var reg = new RegExp('(^|&)' + Parametername + '=([^&]*)(&|$)');
	var r = window.location.search.substr(1).match(reg);
	if (r != null) return decodeURIComponent(r[2]);
	return null;
}

//获取Url传弟的所有参数Json
function _QueryParmJson() {
	var parmString = window.location.search.substr(1);
	if (parmString) {
		var arrPara = parmString.split('&');
		var json = {};
		$.each(arrPara, function(i, item) {
			var arr = item.split('=');
			json[arr[0]] = decodeURI(arr[1]);
		});
		return json;
	}
	return null;
}

function __isExitsFunction(funcName) {
	if (funcName == null || funcName == "" || funcName == undefined) {
		return false;
	}
	try {
		if (typeof(eval(funcName)) == 'function' || typeof(eval(funcName)) == 'object') {
			return true;
		}
	} catch (e) {}
	return false;
}

//判断是否为Json对象
function _IsJSON(object) {
	var str = object;
	if (str.blank()) return false;
	str = str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@');
	str = str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']');
	str = str.replace(/(?:^|:|,)(?:\s*\[)+/g, '');
	return (/^[\],:{}\s]*$/).test(str);
}

//生成随机guid数,isMiddline是否加黄线，默认true
function _GetGuid(isMiddline) {
	isMiddline = isMiddline == undefined ? true : isMiddline;
	var charStr = isMiddline ? '-' : '';
	var S4 = function() {
		return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
	};
	return (S4() + S4() + charStr + S4() + charStr + S4() + charStr + S4() + charStr + S4() + S4() + S4());
}

//转换为脚本原型
function _EvalScripts(object) {
	return object.extractScripts().map(function(script) {
		return eval(script);
	});
}

//进行HTML编码，即代码转为显示字符
function _EscapeHTML(object) {
	return object.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
}

//Html反编码，即转为编程代码
function _UnescapeHTML(object) {
	return object._StringtrimTags.replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&amp;/g, '&');
}

//编码为中文符号：<转为〈
function _EscapeWeizhichar(object) {
	if (object == null) return null;
	return object.replace(/&/g, '＆').replace(/=/g, '＝').replace(/</g, '＜').replace(/>/g, '＞');;
}

/*四舍五入 将数字转换成指定保留位数 v要保留的位数*/
function _ThisToDecimal(v) {
	return _ToDecimal(this, v);
}

/*四舍五入 将数字转换成指定保留位数 num要转换的数,v要保留的位数*/
function _ToDecimal(num, v) {
	var vv = Math.pow(10, v);
	return Math.round(num * vv) / vv;
}

//检查输入的字符数长度。
function _CheckStringLength(strTemp) {
	var i, sum;
	sum = 0;
	for (i = 0; i < strTemp.length; i++) {
		if ((strTemp.charCodeAt(i) >= 0) && (strTemp.charCodeAt(i) <= 255)) {
			sum = sum + 1;
		} else {
			sum = sum + 2;
		} //汉字占有两个字符
	}
	return sum;
}

//Json转换为String
function _JsonToString(object) {
	return JSON.stringify(object);
}

//获取指定时间N天前的时间
function _getDaysBefore(dateObject, nDay) {
	var date = dateObject || new Date();
	var timestamp = date.getTime();
	var newDate = new Date(timestamp - nDay * 24 * 3600 * 1000);
	return newDate;
}

//获取指定时间N天后的时间
function _getDaysAfter(dateObject, nDay) {
	var date = dateObject || new Date();
	var timestamp = date.getTime();
	var newDate = new Date(timestamp + nDay * 24 * 3600 * 1000);
	return newDate;
}

//格式化日期"yyyy-MM-dd hh:mm:ss",默认yyyy-MM-dd
function _DateObjectFormat(dateObject, format) {
	format = format || 'yyyy-MM-dd';
	var o = {
		'M+': dateObject.getMonth() + 1, //month
		'd+': dateObject.getDate(), //day
		'h+': dateObject.getHours(), //hour
		'm+': dateObject.getMinutes(), //minute
		's+': dateObject.getSeconds(), //second
		'q+': Math.floor((dateObject.getMonth() + 3) / 3), //quarter
		'S': dateObject.getMilliseconds() //millisecond
	};
	if (/(y+)/.test(format)) {
		format = format.replace(RegExp.$1,
			(dateObject.getFullYear() + '').substr(4 - RegExp.$1.length));
	}
	for (var k in o) {
		if (new RegExp('(' + k + ')').test(format)) {
			format = format.replace(RegExp.$1,
				RegExp.$1.length == 1 ? o[k] :
				('00' + o[k]).substr(('' + o[k]).length));
		}
	}
	return format;
}

//Json转数组
function _JsonToArr(jsonObject) {
	var arr = [];
	for (var property in jsonObject) {
		var arrItem = {
			name: property,
			value: jsonObject[property]
		};
		arr.push(arrItem);
	}
	return arr;
}

//将name value对象的数组转Json
function _ArrToJson(arrObject) {
	var n = arrObject.length;
	var jsonString = '{';

	for (var i = 0; i < n; i++) {
		jsonString += ':"';
		jsonString += arrObject[i].name;
		jsonString += ':"';

		jsonString += ':"';
		jsonString += arrObject[i].value;
		jsonString += ':"';

		if (i != n - 1) jsonString += ',';
	}
	var jsonString = '}';
	return Object.toJSON(jsonString);
}

//获取一个随机数
function _GetRandomNum(Min, Max) {
	var Range = Max - Min;
	var Rand = Math.random();
	return (Min + Math.round(Rand * Range));
}

///获取一个时间戳
function _GetTimeRandomNum() {
	var randomCode = new Date().valueOf();
	return randomCode;
}

//reload方式刷新
function _refreshPage() {
	window.location.reload();
}

function _getIEVersionNumber() {
	if (/msie/.test(navigator.userAgent.toLowerCase())) {
		var ua = navigator.userAgent.toLowerCase();
		return IEVersion = ua.match(/msie ([\d.]+)/)[1];
	}
	return '';
}

/*
 * 获得时间差,时间格式为 年-月-日 小时:分钟:秒 或者 年/月/日 小时：分钟：秒
 * 其中，年月日为全格式，例如 ： 2010-10-12 01:00:00
 * 返回精度为：秒，分，小时，天
 *diffType：day，minute，hour，second,zw中文读法显示
 *var result = GetDateDiff("2010-02-26 16:00:00", "2011-07-02 21:48:40", "day");
 *var result = GetDateDiff(date1, date2, "day");
 * startTime和endTime:可以是字符串也可以是date对象
 */
function _GetDateDiff(startTime, endTime, diffType) {
	//将xxxx-xx-xx的时间格式，转换为 xxxx/xx/xx的格式
	var sTime = null;
	var eTime = null;
	if (typeof startTime == 'string') {
		startTime = startTime.replace(/\-/g, '/');
		endTime = endTime.replace(/\-/g, '/');
		sTime = new Date(startTime); //开始时间
		eTime = new Date(endTime); //结束时间
	} else {
		sTime = startTime;
		eTime = endTime;
	}
	//将计算间隔类性字符转换为小写
	diffType = diffType.toLowerCase();

	//作为除数的数字
	var divNum = 1;
	if (diffType == 'zw') {
		var time = parseFloat((eTime.getTime() - sTime.getTime())) / 1000;
		return _GetSecondToZwDate(time);
	}
	switch (diffType) {
		case 'second':
			divNum = 1000;
			break;
		case 'minute':
			divNum = 1000 * 60;
			break;
		case 'hour':
			divNum = 1000 * 3600;
			break;
		case 'day':
			divNum = 1000 * 3600 * 24;
			break;
		default:
			break;
	}
	var subdif = parseFloat((eTime.getTime() - sTime.getTime()) / parseInt(divNum));
	return _ToDecimal(subdif, 1);
}

//将秒数转为多少天多少小时多少分的中文字符串
function _GetSecondToZwDate(msd) {
	var time = msd;
	if (null != time && '' != time) {
		if (time > 60 && time < 60 * 60) {
			time = parseInt(time / 60.0) + '分钟' + parseInt((parseFloat(time / 60.0) -
				parseInt(time / 60.0)) * 60) + '秒';
		} else if (time >= 60 * 60 && time < 60 * 60 * 24) {
			time = parseInt(time / 3600.0) + '小时' + parseInt((parseFloat(time / 3600.0) -
					parseInt(time / 3600.0)) * 60) + '分钟' +
				parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) -
					parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + '秒';
		} else if (time >= 60 * 60 * 24) {
			time = parseInt(time / 3600.0 / 24) + '天' + parseInt((parseFloat(time / 3600.0 / 24) -
					parseInt(time / 3600.0 / 24)) * 24) + '小时' + parseInt((parseFloat(time / 3600.0) -
					parseInt(time / 3600.0)) * 60) + '分钟' +
				parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) -
					parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + '秒';
		} else {
			time = parseInt(time) + '秒';
		}
	}
	return time;
}

function _copyToClipboard(txt) {
	if (window.clipboardData) {
		window.clipboardData.clearData();
		window.clipboardData.setData('Text', txt);
		return true;
	}
	if (window.copy) {
		window.copy(txt);
		return true;
	} else if (navigator.userAgent.indexOf('Opera') != -1) {
		window.location = txt;
		return true;
	} else if (window.netscape) {
		try {
			netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
		} catch (e) {
			alert('被浏览器拒绝！\n请在浏览器地址栏输入\'about:config\'并回车\n然后将\'signed.applets.codebase_principal_support\'设置为\'true\'');
		}
		var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
		if (!clip) return;
		var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
		if (!trans) return;
		trans.addDataFlavor('text/unicode');
		var str = new Object();
		var len = new Object();
		var str = Components.classes['@mozilla.org/supports-string;1'].createInstance(Components.interfaces.nsISupportsString);
		var copytext = txt;
		str.data = copytext;
		trans.setTransferData('text/unicode', str, copytext.length * 2);
		var clipid = Components.interfaces.nsIClipboard;
		if (!clip) return false;
		clip.setData(trans, null, clipid.kGlobalClipboard);
		return true;
	}
}

function _parentIframeHeightAdapt(iframeId) {
	if (window.parent && window.parent._iframeHeightAdapt) {
		window.parent._iframeHeightAdapt(iframeId);
	}
}

function _iframeHeightAdapt(iframeId) {
	var ifm = document.getElementById(iframeId);
	var subWeb = document.frames ? document.frames[iframeId].document : ifm.contentDocument;
	if (ifm != null && subWeb != null) {
		ifm.height = subWeb.body.scrollHeight;
		ifm.width = subWeb.body.scrollWidth;
	}
}

//返回true false
function _isMobile() {
	var ua = navigator.userAgent;
	var ipad = ua.match(/(iPad).*OS\s([\d_]+)/),
		isIphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/),
		isAndroid = ua.match(/(Android)\s+([\d.]+)/),
		isMobile = isIphone || isAndroid;
	return isMobile != null && isMobile != '';
}

function _number_to_Chinese(Num) {
	for (i = Num.length - 1; i >= 0; i--) {
		Num = Num.replace(',', ''); //替换tomoney()中的“,”
		Num = Num.replace(' ', ''); //替换tomoney()中的空格
	}
	Num = Num.replace('￥', ''); //替换掉可能出现的￥字符
	if (isNaN(Num)) { //验证输入的字符是否为数字
		alert('请检查小写金额是否正确');
		return;
	}
	//---字符处理完毕，开始转换，转换采用前后两部分分别转换---//
	part = String(Num).split('.');
	newchar = '';
	//是否个位数只有一个零
	var isOnlyZero = false;
	if (part[0].length == 1 && part[0].charAt(0) == '0') {
		isOnlyZero = true;
	}
	//小数点前进行转化
	for (i = part[0].length - 1; i >= 0; i--) {
		if (part[0].length > 10) {
			alert('位数过大，无法计算大额金额');
			return '';
		} //若数量超过拾亿单位，提示
		tmpnewchar = '';
		perchar = part[0].charAt(i);
		switch (perchar) {
			case '0':
				tmpnewchar = '零' + tmpnewchar;
				break;
			case '1':
				tmpnewchar = '壹' + tmpnewchar;
				break;
			case '2':
				tmpnewchar = '贰' + tmpnewchar;
				break;
			case '3':
				tmpnewchar = '叁' + tmpnewchar;
				break;
			case '4':
				tmpnewchar = '肆' + tmpnewchar;
				break;
			case '5':
				tmpnewchar = '伍' + tmpnewchar;
				break;
			case '6':
				tmpnewchar = '陆' + tmpnewchar;
				break;
			case '7':
				tmpnewchar = '柒' + tmpnewchar;
				break;
			case '8':
				tmpnewchar = '捌' + tmpnewchar;
				break;
			case '9':
				tmpnewchar = '玖' + tmpnewchar;
				break;
		}
		switch (part[0].length - i - 1) {
			case 0:
				tmpnewchar = tmpnewchar + '元';
				break;
			case 1:
				if (perchar != 0) tmpnewchar = tmpnewchar + '拾';
				break;
			case 2:
				if (perchar != 0) tmpnewchar = tmpnewchar + '佰';
				break;
			case 3:
				if (perchar != 0) tmpnewchar = tmpnewchar + '仟';
				break;
			case 4:
				tmpnewchar = tmpnewchar + '万';
				break;
			case 5:
				if (perchar != 0) tmpnewchar = tmpnewchar + '拾';
				break;
			case 6:
				if (perchar != 0) tmpnewchar = tmpnewchar + '佰';
				break;
			case 7:
				if (perchar != 0) tmpnewchar = tmpnewchar + '仟';
				break;
			case 8:
				tmpnewchar = tmpnewchar + '亿';
				break;
			case 9:
				tmpnewchar = tmpnewchar + '拾';
				break;
		}

		newchar = tmpnewchar + newchar;
	}
	//小数点之后进行转化
	if (Num.indexOf('.') != -1) {
		if (part[1].length > 2) {
			//alert("小数点之后只能保留两位,系统将自动截段");
			part[1] = part[1].substr(0, 2);
		}
		for (i = 0; i < part[1].length; i++) {
			tmpnewchar = '';
			perchar = part[1].charAt(i);
			switch (perchar) {
				case '0':
					tmpnewchar = '零' + tmpnewchar;
					break;
				case '1':
					tmpnewchar = '壹' + tmpnewchar;
					break;
				case '2':
					tmpnewchar = '贰' + tmpnewchar;
					break;
				case '3':
					tmpnewchar = '叁' + tmpnewchar;
					break;
				case '4':
					tmpnewchar = '肆' + tmpnewchar;
					break;
				case '5':
					tmpnewchar = '伍' + tmpnewchar;
					break;
				case '6':
					tmpnewchar = '陆' + tmpnewchar;
					break;
				case '7':
					tmpnewchar = '柒' + tmpnewchar;
					break;
				case '8':
					tmpnewchar = '捌' + tmpnewchar;
					break;
				case '9':
					tmpnewchar = '玖' + tmpnewchar;
					break;
			}
			if (i == 0) tmpnewchar = tmpnewchar + '角';
			if (i == 1) tmpnewchar = tmpnewchar + '分';
			newchar = newchar + tmpnewchar;
		}
	}
	//替换所有无用汉字
	while (newchar.search('零零') != -1) {
		newchar = newchar.replace('零零', '零');
	}
	newchar = newchar.replace('零亿', '亿');
	newchar = newchar.replace('亿万', '亿');
	newchar = newchar.replace('零万', '万');
	if (isOnlyZero == false) {
		newchar = newchar.replace('零元', '元');
	}
	newchar = newchar.replace('零角', '');
	newchar = newchar.replace('零分', '');

	if (newchar.charAt(newchar.length - 1) == '元' || newchar.charAt(newchar.length - 1) == '角') {
		newchar = newchar + '整';
	}
	return newchar;

}

/*********************最小单元通用独立方法结束******************************************/

/*********************Aajx操作******************************************/
function _ajaxDownloadFile(url, method, data) {
	var theData = [];
	var item = {
		name: 'method',
		value: method
	};
	if (!Object.toIsArray(data)) {
		//Json参数形式,需转数组
		var arr = Object.toJsonToArr(data);
		theData = arr;
	} else {
		//数组参数形式
		theData = data;
	};
	var postUrl = url + method;
	if (__serverpath != '' && !Object.toStartWith(postUrl, __serverpath) && !Object.toStartWith(postUrl, 'http')) {
		postUrl = __serverpath + postUrl;
	}
	var form = $("<form method='POST' action='" + postUrl + "'>");
	$('body').append(form);
	var author = window.sessionStorage.getItem('f2bpmAuthor');
	author=eval("("+author+")");
	form.ajaxSubmit({
		data: theData,
		url: postUrl,
		type: 'post',
		responseType: 'blob',
		headers: {
			"f2bpmToken": author.token
		},
		beforeSubmit: function() {
			Object.toShowLoading();
		},
		success: function(data, status, response) {
			form.remove();
			Object.toCloseLoading();
			var contentDisposition = response.getResponseHeader('Content-Disposition');
			if (contentDisposition && contentDisposition.indexOf("attachment") > -1) {
				var arr = contentDisposition.split(";");
				var fileName = "";
				$.each(arr, function(i, str) {
					if (str.indexOf("filename=") > -1) {
						fileName = str.substring(str.indexOf("filename=") + 9);
						fileName = decodeURI(fileName.toLowerCase());
					}
				});
				var blob = new Blob([data], {
					type: 'application/x-msdownload;charset=utf-8'
				});
				var downloadElement = document.createElement('a');
				var href = window.URL.createObjectURL(blob); // 创建下载的链接
				downloadElement.href = href;
				downloadElement.download = fileName; // 下载后文件名
				document.body.appendChild(downloadElement);
				downloadElement.click(); // 点击下载
				window.URL.revokeObjectURL(href); // 释放掉blob对象
			} else {
				alert("下载出错");
			}

		},
		error: function(data) {
			form.remove();
			console.info(data);
			Object.toCloseLoading();
			alert("提交出错：" + data.responseText);
		}
	});
}
/*********************Aajx操作结束******************************************/

/**
 * 给URL最后面加上时间戳,参数 paramObject.a=a paramObject.b=bbb;
 */
function buildUrl(url, paramObject) {
	if (paramObject) {
		var queryString = '';
		var attrs = paramObject.attributes;
		for (var attr in paramObject) {
			var name = attr;
			var value = paramObject[attr];

			if (queryString.length > 0) {
				queryString += '&';
			}
			queryString += name + '=' + encodeURI(value);
		}
		if (queryString.length > 0) {
			if (url.indexOf('?') >= 0) {
				url = url + '&' + queryString;
			} else {
				url = url + '?' + queryString;
			}
		}
	}
	return url;
}

//判断Jquery是否绑定了点击事件：示例： Object.toIsHadBindClickEvent($("#myli"));
function _isHadBindClickEvent(jqueryObject) {
	var objEvt = $._data(jqueryObject[0], 'events');
	if (objEvt && objEvt['click']) {
		return true;
	}
	return false;
}

//加载遮罩层
function _showLoading2(message, loadingId) {
	if ($('#' + loadingId).size() > 0) return false;
	var msg = message || ' ';
	if (window && window.document) {
		var paddingtop = parseInt(window.document.documentElement.clientHeight / 2);
		var opacity = 'opacity:0.4;';
		//IE 7 8 9
		if (/msie/.test(navigator.userAgent.toLowerCase())) {
			var ua = navigator.userAgent.toLowerCase();
			var IEVersion = ua.match(/msie ([\d.]+)/)[1];
			if (parseInt(IEVersion) < 10) {
				opacity = 'filter: alpha(opacity =40);';
			}
		}
		//opacity = "filter: alpha(opacity =70);";
		loadingId = loadingId || 'LoadingDiv';
		var loadingHtml = '<div id="' + loadingId +
			'" style=\'text-align:center; border:solid 2px #D4F0FC; font-weight: bold; float: left; width: 98%;  height:98%;line-height: 98%;  position: absolute;  top: 1px; left: 1px; z-index: 99000000;' +
			opacity + '" style="text-align: center; background-color:#F6F6F6;  font-size: 14px; color:#FE9A81; padding-top:' +
			paddingtop +
			'px;\'><div><img alt="" style=\'margin-bottom:3px;height:32px;width:32px;cursor:pointer\' title=\'关闭遮罩层\' onclick="_closeLoading(\'' +
			loadingId + '\');" src="' + __webpath + '/resources/images/mask_loading.gif" /></div><div>' + msg + '</div></div>';
		if ($('body')) {
			if ($('#' + loadingId)[0]) {
				$('#' + loadingId).show();
			} else {
				$(document.body).append(loadingHtml);
				$('#' + loadingId).show();
			}
		}
	}
}

//加载遮罩层
function _showLoading(message, loadingId) {
	if (loadingId && $('#' + loadingId).size() > 0) return false;
	var opacity = 'opacity:0.2;';
	//IE 7 8 9
	if (/msie/.test(navigator.userAgent.toLowerCase())) {
		var ua = navigator.userAgent.toLowerCase();
		var IEVersion = ua.match(/msie ([\d.]+)/)[1];
		if (parseInt(IEVersion) < 10) {
			opacity = 'filter: alpha(opacity =20);';
		}
	}
	var msg = message || ' ';
	loadingId = loadingId || 'LoadingDiv'; //background-color:#F6F6F6;
	var loadingHtml = '<div id="' + loadingId +
		'" style=\'width:99%; height: 99%; text-align:center; border:0;   position: absolute;  top:1px; z-index: 1000;  ' +
		opacity +
		'\'><div style="position: relative;  top:40%;"><img alt="" style=\'margin-bottom:3px;height:32px;width:32px;cursor:pointer\' title=\'关闭遮罩层\' onclick="_closeLoading(\'' +
		loadingId + '\');" src="' + __webpath + '/resources/images/mask_loading.gif" /><div>' + msg + '</div></div></div>';
	if (loadingId == 'LoadingDiv' && $('#' + loadingId).size() > 0) {
		$('#' + loadingId).remove();
	}
	if ($('body')) {
		if ($('#' + loadingId).size() > 0) {
			$('#' + loadingId).show();
		} else {
			$(document.body).append(loadingHtml);
			$('#' + loadingId).show();
		}
	}
}

//关闭遮罩层
function _closeLoading(loadingId) {
	loadingId = loadingId || 'LoadingDiv';
	if ($('#' + loadingId).size() > 0) {
		$('#' + loadingId).remove();
		//$('#' + loadingId).hide();
	}
}

/////////////////////////////////////////////////// 窗口结束///////////////////////////////////

///////////////////////////////////////////////////Xml操作///////////////////////////////////
//创建Xml文档对象
//是否给xmlText加一个Root根节点,默认否
//$(xmlDoc).find("Root>Item").each(function () {
//$(this).attr("Text")取属性
//$(this).text() 取内容
//});
function _createXmlDoc(xmlText, isNeedAddRoot) {
	var xmlDoc = null;
	var addRoot = isNeedAddRoot || false;
	if (addRoot) {
		xmlText = '<Root>' + xmlText + '</Root>';
	}
	try //Internet Explorer
	{
		xmlDoc = new ActiveXObject('Microsoft.XMLDOM');
		xmlDoc.async = 'false';
		xmlDoc.loadXML(xmlText);

	} catch (e) {
		try //Firefox, Mozilla, Opera, etc.
		{
			parser = new DOMParser();
			xmlDoc = parser.parseFromString(xmlText, 'text/xml');
		} catch (e) {}
	}
	return xmlDoc;
}

function isUndefined(v) {
	return v == undefined;
}
//是否为函数类型
function isFunction(object) {
	return typeof object == 'function';
}
//是否为数字类型
function isNumber(object) {
	return typeof object == "number";
}
//是否为字符串类型
function isString(object) {
	return typeof object == "string";
}
//获取当前日期时间
function getCurrentDateTimeString() {
	var myDate = new Date();
	return myDate.toDateFormat('yyyy-MM-dd HH:mm:ss');
}
//日期字符串2016-12-12 23:22:3 形式转为日期对象
function _getDateObjectFromstr(dateString) {
	if (!dateString) return '';
	return new Date(dateString.replace(/-/g, '/'));
}

///获取当前日期
function getCurrentDateString() {
	var myDate = new Date();
	return myDate.toDateFormat('yyyy-MM-dd');
}

//是否为日期2015-1-01 23:59的字符串形式
function isDateStr(dateStr) {
	if (!isNaN(dateStr) && (typeof dateStr == 'string') && dateStr.length.toString() == 13) return false;
	var r = /^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})/.test(dateStr);
	return r;
}

function stringToJson(str) {
	return eval('(' + str + ')');
}
//是否 为空，null,undefined
function isEmpty(object) {
	if (object == null || object == undefined || object == 'null' || object == '') {
		return true;
	}
	return false;
}

function getFunctionName(obj) {
	if (typeof obj == 'string') {
		return obj;
	}
	if (typeof obj != 'function' || obj === null) {
		return null;
	} else {
		var funName = /\s([^(]+)/.exec(obj.toString())[1];
		if (funName.indexOf("[native code]") > -1) {
			return obj;
		}
	}
}


//在指定的控件光标处插入字符串
function insertAtCursor(inputId, myValue) {
	var myField = document.getElementById(inputId);
	//IE support
	if (document.selection) {
		myField.focus();
		sel = document.selection.createRange();
		sel.text = myValue;
		sel.select();
	}
	//MOZILLA/NETSCAPE support
	else if (myField.selectionStart || myField.selectionStart == '0') {
		var startPos = myField.selectionStart;
		var endPos = myField.selectionEnd;
		// save scrollTop before insert www.keleyi.com
		var restoreTop = myField.scrollTop;
		myField.value = myField.value.substring(0, startPos) + myValue + myField.value.substring(endPos, myField.value.length);
		if (restoreTop > 0) {
			myField.scrollTop = restoreTop;
		}
		myField.focus();
		myField.selectionStart = startPos + myValue.length;
		myField.selectionEnd = startPos + myValue.length;
	} else {
		myField.value += myValue;
		myField.focus();
	}
}

//字符串替换全部
//str:字符串
//s1:要替换的值
//s2:替换成的新值
function replaceAll(str, s1, s2, ignoreCase) {
	if ('.' == s1) {
		while (str.indexOf(s1) != -1) {
			str = str.replace(s1, s2);
		}
		return str;
	} else {
		if (!RegExp.prototype.isPrototypeOf(s1)) {
			return str.replace(new RegExp(s1, (ignoreCase ? 'gi' : 'g')), s2);
		} else {
			return str.replace(s1, s2);
		}
	}
};
//========数字相关=====
//转十六进制
function toColorPart() {
	return this.toPaddedString(2, 16);
}

//加1
function succ() {
	return this + 1;
}

//位数，不足左边加0，radix：进制基数，即2二进制，10十进制，8八进制，16进制
function toPaddedString(length, radix) {
	var string = this.toString(radix || 10);
	return '0'.toCopyTimes(length - string.length) + string;
}

//取绝对数
function abs() {
	return Math.abs(this);
}

//四舍五入取整
function round() {
	return Math.round(this);
}

//向上取整
function ceil() {
	return Math.ceil(this);
}

//向下取整
function floor() {
	return Math.floor(this);
}

function stringToDate(str) {
	str = str.replace(/-/g, '/'); // "2010/08/01";
	var date = new Date(str);
	return date;
}

//两个日期相隔多少天
function getDatePeriodDay(startDate, endDate) {
	return (Math.abs(startDate * 1 - endDate * 1) / 60 / 60 / 1000 / 24).toFloor();
}

//获取日期所在月的第一天
function getFirstDateInMonth(date) {
	if (date == null) date = this;
	return new Date(date.getFullYear(), date.getMonth(), 1);
}

//获取日期所在月的最后天
function getLastDateInMonth(date) {
	if (date == null) date = this;
	return new Date(date.getFullYear(), date.getMonth() + 1, 0);
}

//获取日期所在季的第一天
function getFirstDateInQuarter(date) {
	if (date == null) date = this;
	return new Date(date.getFullYear(), ~~(date.getMonth() / 3) * 3, 1);
}

//获取日期所在季的第一天
function getLastDateInQuarter(date) {
	if (date == null) date = this;
	return new Date(date.getFullYear(), ~~(date.getMonth() / 3) * 3 + 3, 0);
}

//是否为闰年
function isLeapYear() {
	return new Date(this.getFullYear(), 2, 0).getDate() == 29;
}

//获取当前月份的天数
function getDaysInMonth(date) {
	if (date == null) date = this;
	return new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();
}

function dateTimeFormatter(value) {
	return formatDate(value, 'yyyy-MM-dd hh:mm:ss');
}

function dateFormatter(value) {
	return formatDate(value, 'yyyy-MM-dd');
}

function formatDate(v, dateFormat) {
	try {
		if (v == null || v == '') return '';

		if (myObject.toIsDateStr(v) && dateFormat == 'yyyy-MM-dd hh:mm:ss' && v.length > 10) {
			return v;
		} else if (myObject.toIsDateStr(v) && dateFormat == 'yyyy-MM-dd' && v.length == 10) {
			return v;
		} else if (myObject.toIsDateStr(v)) {
			return new Date(v).toDateFormat(dateFormat);
		}
		if (dateFormat == undefined || typeof dateFormat != 'string') {
			dateFormat = 'yyyy-MM-dd';
		}

		if ((typeof v) == 'number') {
			var o = new Date(v * 1000);
			return o.toDateFormat(dateFormat);
		}
		if ((typeof v) == 'string' && v.indexOf('/Date(') == 0) {
			var date = eval('new ' + eval(v).source);
			return date.toDateFormat(dateFormat);
		}
		if (v.time) {
			var o = new Date(v.time);
			return o.toDateFormat(dateFormat);
		}
		if (v.getDay()) {
			return v.toDateFormat(dateFormat);
		} else {
			if (v != '') {
				v = v.replace(/\//g, '-');
				if (v == '1900-01-01 00:00:00') {
					return '--';
				}
				if (v.split(' ')) {
					var myDate = v.split(' ')[0];
				} else {
					var myDate = v;
					var myTime = '';
				}
				myDate = myDate.replace('-0', '-').replace('-0', '-');
				var nowDate = new Date();
				/*TD 7111*/
				if (myDate.split('-')[0] == '1900') {
					return '--';
				}
				if (myDate.split('-')[0] == nowDate.getFullYear()) { //本年度 For td 5858
					return myDate.split('-')[0] + '年' + myDate.split('-')[1] + '月' + myDate.split('-')[2] + '日';

				} else { //非本年度
					return myDate.split('-')[0] + '年' + myDate.split('-')[1] + '月' + myDate.split('-')[2] + '日';
				}
			} else {
				return '--';
			}
		}
	} catch (e) {
		console.info(e);
	}
	return '--';
};

function toPinYin(content, isFirstToLower) {
	var v = $.toPinyinByText(content);
	if (isFirstToLower == true) {
		v = v.substr(0, 1).toLowerCase() + v.substr(1);
	}
	return v;
}

function toPinYin2(content) {
	var v = $.toPinyinByText(content);
	return v;
}
//隐私字符串，使用指定字符隐藏关键信息，默认是使用*代替，只显示第一个汉字，隐藏其它汉字
function toSecrecy(str, character) {
	if (str) {
		character = character || '*';
		str = str.replace(/([\u4E00-\u9FA5]{1})([\u4E00-\u9FA5]+)$/, '$1' + character + character + character + character);
	}
	return str;
}
//流程处理人姓名隐私
function toProcSecrecy(str, character) {
	try {
		if (str && $f2bpmProcSecrecy == true) {
			character = character || '*';
			str = str.replace(/([\u4E00-\u9FA5]{1})([\u4E00-\u9FA5]+)$/, '$1' + character + character + character + character);
		}
	} catch (e) {
		return str;
	}
	return str;
}

//========日期Date 结束=====

///////////////////////////////////////////////////Xml操作结束///////////////////////////////////

// 根据某个字段实现对json数组的排序
//data:要排序的数据
//field:排序的字段
//isreverse:是否倒序
//isReSetOrderNum：是否重置排序号从小到大
//stepLength:重置排序号的步长，默认为1
function _dataSort(data, field, reverse, isReSetOrderNum, stepLength) {
	if (stepLength == undefined) {
		stepLength = 1;
	}
	//数组长度小于2 或 没有指定排序字段 或 不是json格式数据
	if (data.length < 2 || !field || typeof data[0] !== "object") return data;
	//数字类型排序
	if (typeof data[0][field] === "number") {
		data.sort(function(x, y) {
			return x[field] - y[field]
		});
	}
	//字符串类型排序
	if (typeof data[0][field] === "string") {
		data.sort(function(x, y) {
			return x[field].localeCompare(y[field])
		});
	}
	//倒序
	if (reverse) {
		data.reverse();
	}
	if (isReSetOrderNum) {
		data.forEach(function(item, index, arr) {
			item[field] = index + stepLength;
		});
	}
	return data;
}
myObject.toIsArray = isArray;
myObject.toIsFunction = isFunction;
myObject.toIsString = isString;
myObject.toIsNumber = isNumber;
myObject.toIsUndefined = isUndefined;
myObject.toPinYin = toPinYin;
myObject.toPinYin2 = toPinYin2;
myObject.toStringToJson = stringToJson;
myObject.toCloneArray = cloneArray;
myObject.toDeepClone = deepClone;
myObject.toGetFunctionName = getFunctionName;
myObject.toReplaceAll = replaceAll;
myObject.toInsertAtCursor = insertAtCursor; //在光标处插入字符串
//数字相关
myObject.toColorPart = toColorPart; //转十六进制
myObject.toSucc = succ;
myObject.toPaddedString = toPaddedString;
myObject.toAbs = abs;
myObject.toTound = round;
myObject.toCeil = ceil;
myObject.toFloor = floor;
myObject.toDecimal = _ThisToDecimal;

//日期相关
myObject.toIsDate = isDate;
myObject.toJsonDateTimeFormatter = dateTimeFormatter;
myObject.toJsonDateFormatter = dateFormatter;
myObject.toIsDateStr = isDateStr;
myObject.toIsJavaDateObj = isJavaDateObject;
myObject.toGetDateObjectFromstr = _getDateObjectFromstr;
myObject.toGetCurrentDateTimeString = getCurrentDateTimeString;
myObject.toGetCurrentDateString = getCurrentDateString;
myObject.toDateObjectFormat = _DateObjectFormat;
myObject.toStringToDate = stringToDate;
myObject.toGetDatePeriodDay = getDatePeriodDay;
myObject.toGetFirstDateInMonth = getFirstDateInMonth;
myObject.toGetLastDateInMonth = getLastDateInMonth;
myObject.toGetFirstDateInQuarter = getFirstDateInQuarter;
myObject.toGetLastDateInQuarter = getLastDateInQuarter;
myObject.toIsLeapYear = isLeapYear;
myObject.toGetDaysInMonth = getDaysInMonth;

//==外部也可直接使用的函数==========================
myObject.toIsExitsFunction = __isExitsFunction;
myObject.toQueryParmJson = _QueryParmJson;
myObject.toQueryString = _QueryString;
myObject.toStringFormat = _StringFormat;
myObject.toIsJSON = _IsJSON;
myObject.toEvalScripts = _EvalScripts;
myObject.toEscapeHTML = _EscapeHTML;
myObject.toUnescapeHTML = _UnescapeHTML;
myObject.toEscapeWeizhichar = _EscapeWeizhichar;
myObject.toDecimal = _ToDecimal;
myObject.toCheckStringLength = _CheckStringLength;
myObject.toJsonToString = _JsonToString;
myObject.toIsEmpty = isEmpty;
myObject.toGetDaysBefore = _getDaysBefore;
myObject.toGetDaysAfter = _getDaysAfter;
myObject.toAjaxJson = _ajaxJson;
myObject.toAjaxDownloadFile = _ajaxDownloadFile;
myObject.toJsonToArr = _JsonToArr;
myObject.toArrToJon = _ArrToJson;
myObject.toShowLoading = _showLoading;
myObject.toCloseLoading = _closeLoading;
myObject.toCreateXmlDoc = _createXmlDoc;
myObject.toRefreshPage = _refreshPage;
myObject.toBuildUrl = buildUrl;
myObject.toGetTimeRandomNum = _GetTimeRandomNum;
myObject.toGetRandomNum = _GetRandomNum;
myObject.toGetDateDiff = _GetDateDiff;
myObject.toGetSecondToZwDate = _GetSecondToZwDate;
myObject.toGuid = _GetGuid;
myObject.toGetIEVersionNo = _getIEVersionNumber;
myObject.toIsHadBindClickEvent = _isHadBindClickEvent;
myObject.toCopyToClipboard = _copyToClipboard;
myObject.toIframeHeightAdapt = _iframeHeightAdapt;
myObject.toParentIframeHeightAdapt = _parentIframeHeightAdapt;
myObject.toIsMobile = _isMobile;
myObject.toSecrecy = toSecrecy;
myObject.toProcSecrecy = toProcSecrecy;
myObject.toTrim = _Stringtrim;
myObject.toTrimTags = _StringtrimTags;
myObject.toStartWith = _StringStartWith;
myObject.toEndWith = _StringEndWith;
myObject.toCapitalize = _StringCapitalize; //首字母大写
myObject.toIncludeString = _IncludeString;
myObject.toTruncate = _Truncate2; //保留指定中文长度，默认25中文字符长度，truncation：默认为...
myObject.toSucc = _Succ; //加1操作，对数字类型的字符串
myObject.toCopyTimes = _CopyTimes //复制N次字符串
//数字转为大写金额
myObject.toChinaNum = _number_to_Chinese
//对数组排序，默认升序
myObject.dataSort = _dataSort
myObject.toStringFormat = _StringFormat;


Date.prototype.toDateFormat = _DateFormat;
if (!Vue.prototype.$myObject) {
	Vue.prototype.$myObject = myObject;
}
export default myObject; 
